package com.easypan.controller;

import com.easypan.Service.FileInfoService;
import com.easypan.entity.dto.SessionwebUserDto;
import com.easypan.entity.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/recycle")
public class recycleController {
///    接口状态: 开发中
//    接口URL: POSThttp://localhost:7090/api/recycle/loadRecycleList
//    Content-Type: multipart/form-data
//    认证方式:无需认证
@Autowired
    FileInfoService fileInfoService;
@PostMapping("/loadRecycleList")
    public R loadRecycleList(String pageNo, String pageSize, HttpSession session)
{
    SessionwebUserDto webUserDto = (SessionwebUserDto) session.getAttribute("session_key");
    //根据回收字段 +userid ->遍历出所有的回收站
  R r=  fileInfoService.loadRecycleList(webUserDto,pageNo,pageSize);
    return r;
}
@PostMapping("/recoverFile")
    public  R recoverFile()
{

    return  R.error("听一百次反方向的钟 找管理员还原");
}
@PostMapping("/delFile")
public  R delFile()
{

    return  R.error("删除失败,该接口未开发");
}
}
